# -*- coding: utf-8 -*-
# @Time    : 2021/10/19 20:33
# @Author  : huangwei
# @File    : excel.py
# @Software: PyCharm

from openpyxl import Workbook
from openpyxl.styles import Alignment

book = Workbook()
sheet = book.active

sheet.merge_cells('A1:B2')

cell = sheet.cell(row=1, column=1)
cell.value = 'Sunny day'
cell.alignment = Alignment(horizontal='center', vertical='center')

book.save('merging.xlsx')
